#if 0	//功能测试
#include <stdio.h>
#include <unistd.h>
#include <sys/wait.h>


void lap_execl(void)
{
	execl("/bin/ls","ls","-a",NULL);
}

void lap_execv(void)
{
	char *const arg[]={"ls","-a","-l",NULL};
	execv("/bin/ls",arg);
}


int main(void)
{
	pid_t id = -1;
	int stat = -1;
	

	//创建子线程
	id = fork();
	if(id == 0)	//子线程
	{
		printf("Son fork:%d\n",getpid());
		lap_execv();
	}
	else if(id > 0) //父线程
	{
		id = wait(&stat);
		printf("get pid:%d    stat:%d\n",id,stat);
	}
	else //线程创建错误
	{
		printf("creat fork err\n");
	}
	
	return 0;
}
#endif







																						 
